from flask import render_template

from apps.dao.LoginDao import LoginDao
from apps.pojo.User import User


# class LoginService:
#     @staticmethod
#     def login(username, password):
#         user = User.query.filter_by(username=username).first()
#
#         if not user:
#             return False
#
#         # 3. 校验密码是否正确（明文比较）
#         if password != user.password:  # 直接比较明文密码
#             return False
#
#         # 4. 如果用户名和密码都匹配，返回登录成功
#         return True


class LoginService:
    @staticmethod
    def login(username, password):
        return LoginDao.login(username, password)
